import { ref, computed, reactive } from 'vue'
import { defineStore } from 'pinia'

export const useCounterStore = defineStore('counter', () => {
  const count = ref(0)
  const currentUser=reactive({
    userId: 0,
    name: "",
    pass: "",
    departmentId:0,
    powerId: null,
  })
  const doubleCount = computed(() => count.value * 2)
  function increment() {
    count.value++
  }

  return { count, doubleCount, increment,currentUser}
}, {
  persist: true  // 保存到本地
})// persist: true 保存到本地
